fix: use turbo build in e2e CI job to resolve missing package artifacts#438
fix: use turbo build in e2e CI job to resolve missing package artifacts#438
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
… e2e job The e2e CI job was failing because the webServer command ran `pnpm --filter @object-ui/console build` which runs tsc directly. tsc failed (exit code 2) because workspace packages' dist/ directories didn't exist (the build job runs on a separate VM and artifacts aren't shared). Changes: - playwright.config.ts: Use `turbo run build` which properly builds dependencies before the console (respects ^build dependency chain) - ci.yml: Add explicit build step before Playwright tests, so the webServer's turbo build is a cache hit (~320ms) Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Fixes flaky/failing Playwright E2E CI runs by ensuring the console’s production build is generated via Turborepo (so workspace package build outputs exist) rather than relying on a prior CI job’s artifacts.
Changes:
- Update Playwright
webServer.commandto runturbo run buildfor@object-ui/consolebefore startingvite preview. - Add an explicit Turbo build step in the CI
e2ejob before installing browsers/running Playwright.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| playwright.config.ts | Switch webServer build to Turborepo to build workspace deps before vite preview. |
| .github/workflows/ci.yml | Add a pre-E2E Turbo build step to ensure build outputs exist in the E2E VM. |
| - name: Build packages and console | ||
| run: pnpm turbo run build --filter='./packages/*' --filter='./apps/console' | ||
|
|
There was a problem hiding this comment.
This step runs a full Turbo build right before E2E, but Playwright's webServer.command also triggers a Turbo build. Unless you make the Playwright command skip building on CI, this duplicates work and can significantly increase CI duration. Either drop this step and keep the webServer build, or keep this step and adjust the Playwright config to only run preview on CI.
| */ | ||
| webServer: { | ||
| command: 'pnpm --filter @object-ui/console build && pnpm --filter @object-ui/console preview --port 4173', | ||
| command: 'pnpm turbo run build --filter=@object-ui/console && pnpm --filter @object-ui/console preview --port 4173', |
There was a problem hiding this comment.
This webServer.command always runs a Turbo build, but the CI workflow also added an explicit Turbo build step before Playwright. That means CI will build twice (once in the workflow step and again here), increasing job time and potentially pushing against the 180s webServer timeout. Consider making the command conditional (CI: run only preview; local: run turbo build && preview), or remove the explicit build step from the workflow and rely on the webServer build alone.
| command: 'pnpm turbo run build --filter=@object-ui/console && pnpm --filter @object-ui/console preview --port 4173', | |
| command: process.env.CI | |
| ? 'pnpm --filter @object-ui/console preview --port 4173' | |
| : 'pnpm turbo run build --filter=@object-ui/console && pnpm --filter @object-ui/console preview --port 4173', |
The e2e CI job fails with
Exit code: 2from the Playwright webServer becausetsccan't resolve types from workspace packages whosedist/directories don't exist. Thebuildjob runs on a separate VM andneeds: buildonly gates execution order — it doesn't share artifacts.playwright.config.ts: Useturbo run build --filter=@object-ui/consoleinstead ofpnpm --filter @object-ui/console buildso turbo's^builddependency chain builds all workspace packages before the console.github/workflows/ci.yml: Add explicit build step before Playwright so the webServer's turbo build is a cache hit (~320ms)💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.